package bizapi.sinosoft.com.provider.order;

import bizapi.sinosoft.com.provider.CommonResponse;
import bizapi.sinosoft.com.provider.order.adapter.OrderAdapter;
import bizapi.sinosoft.com.provider.order.vo.response.SelectOrderVO;
import jd.restful.model.SubmitOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by xujingfeng on 2017/2/8.
 */
@RestController
@RequestMapping("api/order")
public class OrderRestController {

    @Autowired
    OrderAdapter orderAdapter;

    @RequestMapping(value = "submitOrder", method = RequestMethod.POST)
    public CommonResponse<String> submitOrder(SubmitOrderVO submitOrderVO) {
        CommonResponse<String> commonResponse = orderAdapter.takeOrder(submitOrderVO);
        return commonResponse;
    }


    @RequestMapping(value = "selectJdOrder", method = RequestMethod.POST)
    public CommonResponse<SelectOrderVO> selectJdOrder(String orderNo) {
        CommonResponse<SelectOrderVO> commonResponse = orderAdapter.selectOrder(orderNo);
        return commonResponse;

    }

}
